/****************************************************************************
*
*					Functions of class SequencingHeuristicFactory
*
****************************************************************************/

#include "SequencingHeuristicFactory.h"
#include "AllSequencingHeuristicClasses.h"


/****************************************************************************
*					SequencingHeuristicFactory::SequencingHeuristicFactory
*
*	Description:	Standard constructor with initialization of internal parameters
*	Parameters:		-
*	Returns:		-
*
****************************************************************************/
SequencingHeuristicFactory::SequencingHeuristicFactory (void) {
	
}


/****************************************************************************
*					SequencingHeuristicFactory::~SequencingHeuristicFactory
*
*	Description:	Standard destructor with removing all dynamic internal variables
*	Parameters:		-
*	Returns:		-
*
****************************************************************************/
SequencingHeuristicFactory::~SequencingHeuristicFactory (void) {
	
}

/****************************************************************************
*					SequencingHeuristicFactory::createObjectByName
*
*	Description:	Function creates object of ancestor class SequencingHeuristic
*					of a subclass with a given name
*	Parameters:		name - name of the desired subclass of class SequencingHeuristic
*	Returns:		SequencingHeuristic* - new dynamic object of subclass of 
*						SequencingHeuristic with the given name
*
****************************************************************************/
SequencingHeuristic* SequencingHeuristicFactory::createObjectByName(const std::string name) {
	SequencingHeuristic* plClass = NULL;
	// Transforming to lowercase
	std::string nameStr (name);
	std::transform(nameStr.begin(), nameStr.end(), nameStr.begin(), ::tolower);
	// Comparing the names
	if (strcmp (nameStr.c_str(), "greedyrateratio") == 0) {
		plClass = new GreedyRateRatioSequencingHeuristic();
	}
	// Returning the value
	return plClass;
}
